class Card {
    constructor(suit, value) {
        this.suit = suit;
        this.value = value;
        this.selected = false;
    }

    // 获取牌面显示值
    getDisplayValue() {
        const valueMap = {
            '11': 'J',
            '12': 'Q',
            '13': 'K',
            '14': 'A',
            '15': '2',
            '16': '小王',
            '17': '大王'
        };
        return valueMap[this.value] || this.value;
    }

    // 获取花色显示
    getSuitSymbol() {
        const suitMap = {
            'hearts': '♥',
            'diamonds': '♦',
            'clubs': '♣',
            'spades': '♠',
            'joker': ''
        };
        return suitMap[this.suit];
    }

    // 创建牌面DOM元素
    createCardElement() {
        const card = document.createElement('div');
        card.className = `card ${this.suit}`;
        if (this.selected) {
            card.classList.add('selected');
        }

        const value = this.getDisplayValue();
        const symbol = this.getSuitSymbol();
        
        card.innerHTML = `
            <div class="card-value">${value}</div>
            <div class="card-suit">${symbol}</div>
        `;

        return card;
    }
} 